package com.ionehe.group.common.notify.eventbus.factory;


import com.ionehe.group.common.notify.event.factory.EventFactory;
import com.ionehe.group.common.notify.event.listener.EventListener;
import com.ionehe.group.common.notify.event.producer.EventProducer;
import com.ionehe.group.common.notify.eventbus.producer.EventProducerImpl;

/**
 * Copyright (c) 2021 ionehe.com
 * Date: 2021/4/21
 * Time: 1:22 下午
 *
 * @author 2021年 <a href="mailto:a@ionehe.com">秀</a>
 * 【事件工厂类】
 */
public class EventBusFactoryImpl implements EventFactory {
    @Override
    public EventProducer createProducer(String identifier) {
        return (EventProducer) new EventProducerImpl(identifier);
    }

    @Override
    public void createSubscriber(EventProducer eventProducer, EventListener eventListener) {
        eventProducer.addSubscriber(eventListener);
    }
}


